﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="BuscarImagens.aspx.cs" Inherits="BuscarImagens" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div class="demoheading">
        Buscar Imagens</div>
    
    <div class="collapsePanelHeader" style="width:400px; height:15px">Digite os Dados da 
        Pesquisa</div>
    <div style="width:400px; margin-right: 155px;">
        <asp:UpdatePanel ID="upPesquisa" runat="server">
            <ContentTemplate>
                <table style="width: 100%" class="divDados">
                    <tr>
                        <td style="width: 109px">
                            Nome:</td>
                        <td>
                            <asp:TextBox ID="tbNome" runat="server" Width="270px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 109px">
                            Evento:</td>
                        <td>
                            <asp:DropDownList ID="ddlEvento" runat="server" DataSourceID="dsEvento" 
                                DataTextField="Nome" DataValueField="Codigo" AppendDataBoundItems="True">
                                <asp:ListItem Selected="True" Value="0">Selecione um Evento</asp:ListItem>
                            </asp:DropDownList>
                            <asp:ObjectDataSource ID="dsEvento" runat="server" 
                                DataObjectTypeName="Negocios.Evento" InsertMethod="Insere" 
                                OldValuesParameterFormatString="original_{0}" SelectMethod="ConsultaTodos" 
                                TypeName="Negocios.EventoBLL"></asp:ObjectDataSource>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 109px">
                            Autor:</td>
                        <td>
                            <asp:DropDownList ID="ddlAutor" AppendDataBoundItems="True" runat="server" DataSourceID="dsAutor" 
                                DataTextField="Nome" DataValueField="Codigo" Height="16px">
                                <asp:ListItem Selected="True" Value="0">Selecione o Autor</asp:ListItem>
                            </asp:DropDownList>
                            <asp:ObjectDataSource ID="dsAutor" runat="server" 
                                OldValuesParameterFormatString="original_{0}" SelectMethod="ConsultaTodos" 
                                TypeName="Negocios.AutorBLL" DataObjectTypeName="Negocios.Autor" 
                                DeleteMethod="Remove" InsertMethod="Insere" UpdateMethod="Atualiza"></asp:ObjectDataSource>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 109px">
                            Formato:</td>
                        <td>
                            <asp:DropDownList ID="ddlFormato" runat="server" DataSourceID="dsFormato" 
                                DataTextField="Nome" DataValueField="Codigo" AppendDataBoundItems="True">
                                <asp:ListItem Selected="True" Value="0">Selecione o Formato</asp:ListItem>
                            </asp:DropDownList>
                            <asp:ObjectDataSource ID="dsFormato" runat="server" 
                                OldValuesParameterFormatString="original_{0}" SelectMethod="ConsultaTodos" 
                                TypeName="Negocios.FormatoBLL"></asp:ObjectDataSource>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 109px">
                            Especificação:</td>
                        <td>
                            <asp:DropDownList ID="ddlEspecificacao" runat="server" 
                                DataSourceID="dsEspecificacao" DataTextField="Tipo" 
                                DataValueField="Codigo" AppendDataBoundItems="True">
                                <asp:ListItem Selected="True" Value="0">Selecione a Especificação</asp:ListItem>
                            </asp:DropDownList>
                            <asp:ObjectDataSource ID="dsEspecificacao" runat="server" 
                                OldValuesParameterFormatString="original_{0}" SelectMethod="ConsultaTodos" 
                                TypeName="Negocios.EspecificacaoBLL">
                            </asp:ObjectDataSource>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 109px">
                            Software:</td>
                        <td>
                            <asp:DropDownList ID="ddlSoftware" runat="server" DataSourceID="dsSoftware" 
                                DataTextField="Nome" DataValueField="Codigo" AppendDataBoundItems="True">
                                <asp:ListItem Selected="True" Value="0">Selecione o Software</asp:ListItem>
                            </asp:DropDownList>
                            <asp:ObjectDataSource ID="dsSoftware" runat="server" 
                                OldValuesParameterFormatString="original_{0}" SelectMethod="ConsultaTodos" 
                                TypeName="Negocios.Software_De_ReproducaoBLL"></asp:ObjectDataSource>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 109px">
                            &nbsp;</td>
                        <td>
                            <asp:Button ID="btPesquisar" runat="server" Text="Pesquisar" 
                                onclick="btPesquisar_Click" />
                            <asp:Button ID="btLimpar" runat="server" onclick="btLimpar_Click" 
                                Text="Limpar" />
                        </td>
                    </tr>
                </table>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    
    <div class="collapsePanelHeader" style="width:400px; height:15px">Resultado</div>
    <div style="width:400px" class="divDados">
        <asp:UpdatePanel ID="upResultado" runat="server">
            <ContentTemplate>
                <asp:GridView ID="gvResultado" runat="server" AutoGenerateColumns="False" 
                    BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" 
                    CellPadding="4" DataSourceID="dsResultado" ForeColor="Black" 
                    GridLines="Vertical">
                    <FooterStyle BackColor="#CCCC99" />
                    <RowStyle BackColor="#F7F7DE" />
                    <Columns>
                        <asp:BoundField DataField="Cod" HeaderText="Cod" SortExpression="Cod" />
                        <asp:BoundField DataField="Nome" HeaderText="Nome" SortExpression="Nome" />
                        <asp:BoundField DataField="Localizacao" HeaderText="Localizacao" 
                            SortExpression="Localizacao" />
                        <asp:BoundField DataField="Evento" HeaderText="Evento" 
                            SortExpression="Evento" />
                        <asp:BoundField DataField="Autor" HeaderText="Autor" SortExpression="Autor" />
                        <asp:BoundField DataField="Formato" HeaderText="Formato" 
                            SortExpression="Formato" />
                        <asp:BoundField DataField="Especificacao" HeaderText="Especificacao" 
                            SortExpression="Especificacao" />
                        <asp:BoundField DataField="Software" HeaderText="Software" 
                            SortExpression="Software" />
                        <asp:BoundField DataField="Usuario" HeaderText="Usuario" 
                            SortExpression="Usuario" />
                    </Columns>
                    <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
                    <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
                    <AlternatingRowStyle BackColor="White" />
                </asp:GridView>
                <asp:ObjectDataSource ID="dsResultado" runat="server" 
                    DataObjectTypeName="Negocios.Imagem" DeleteMethod="Remove" 
                    InsertMethod="Insere" OldValuesParameterFormatString="original_{0}" 
                    SelectMethod="ConsultarParametros" TypeName="Negocios.ImagemBLL" 
                    UpdateMethod="Atualiza">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="tbNome" DefaultValue="" Name="nome" 
                            PropertyName="Text" Type="String" />
                        <asp:ControlParameter ControlID="ddlEvento" DefaultValue="" Name="evento" 
                            PropertyName="SelectedValue" Type="Int32" />
                        <asp:ControlParameter ControlID="ddlAutor" DefaultValue="" Name="autor" 
                            PropertyName="SelectedValue" Type="Int32" />
                        <asp:ControlParameter ControlID="ddlFormato" DefaultValue="" Name="formato" 
                            PropertyName="SelectedValue" Type="Int32" />
                        <asp:ControlParameter ControlID="ddlEspecificacao" DefaultValue="" 
                            Name="especificacao" PropertyName="SelectedValue" Type="Int32" />
                        <asp:ControlParameter ControlID="ddlSoftware" DefaultValue="" Name="software" 
                            PropertyName="SelectedValue" Type="Int32" />
                    </SelectParameters>
                </asp:ObjectDataSource>
            </ContentTemplate>
        
        </asp:UpdatePanel>
    </div>

</asp:Content>

